/*
 * Stepper.h
 *
 *  Created on: Mar 6, 2011
 *      Author: Jason
 */

#ifndef STEPPER_H_

#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdlib.h>
#include "pin.h"
#include "timer0.h"
#include "stddef.h"


enum stepperStatus {DISABLE,ENABLE,FORWARD,REVERSE,IDLE,BUSY};

class stepper
{
public:
	stepper(void);
	//setup the enable output
	void setupEn(byte, byte);
	//setup the direction output
	void setupDir(byte, byte);
	//setup the step output
	void setupStep(byte, byte);

	//Invert the enable output
	void invertEn(state);
	//Invert the direction output
	void invertDir(state);

	//set and get parameters for the stepper
	void set(stepperStatus);
	state get(stepperStatus);
	
	//pulse the step output
	void pulse(void);

private:
	pin 	_enable;
	pin 	_direction;
	pin 	_step;
};

#define STEPPER_H_


#endif /* STEPPER_H_ */
